package com.tms.j2cache.model;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.lang.annotation.Annotation;

/**
 * @param <T>
 * @author jinyfueng
 * cache信息包装
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AnnotationInfo<T extends Annotation> implements Serializable {
    private T annotation;
    private String region;
    private String key;//region:key:params

    @Override
    public String toString() {
        if (annotation == null) {
            return null;
        }
        return JSONObject.toJSONString(this);
    }
}
